import QuickTool from '@/utils/Engineering/QuickTool';
import { host } from '@/utils/web.domain.config';
import { maintableOperateExpandList } from '../main.data';

const operationList = [
  'handleOperaateJump',
  'handleModalEdit',
  'handleSingleCopy',
  'handleQuickEdit',
  'handleSingleQuickEdit',
  'handleModalSubmit',
  'handleSingleDelete',
];

const apiPath = {
  submitDataBaseURL: `/api/common/sys_table_set_col`,
  getDatasourceURL: `/api/common/sys_table_set_col/page`,
  basis: 'id',
};

const extraData = {
  __sent_data_diff_cover_field: '',
};

const pagination = { pageSize: 10, current: 1 };

const tableOperateExpandList = [
  // maintableOperateExpandList.QuerySetting,
  // maintableOperateExpandList.FormSetting,
  // maintableOperateExpandList.FormFieldSetting,
  // maintableOperateExpandList.TableSettting,
  // maintableOperateExpandList.TableFieldSettting,
];

const popupForm = {
  open_type: 'Drawer',
  width: '65%',
};

const fieldList = [
  {
    form_type: 'Input',
    title_or_label: QuickTool.tooltip({ title: '标题', help: '标题', required: true }),
    dataIndex_or_field: 'title',
    key: 'title',
    fixed: 'left',
    placeholder: '',
    width: 120,
    col: 12,
    initialValue: '',
    list: [],
  },
  {
    form_type: 'Input',
    title_or_label: QuickTool.tooltip({ title: 'UUID码', help: 'UUID码', required: true }),
    dataIndex_or_field: 'sys_table_set_code',
    key: 'sys_table_set_code',
    placeholder: '',
    width: 160,
    col: 12,
    initialValue: '',
    list: [],
  },
  {
    form_type: 'Input',
    title_or_label: QuickTool.tooltip({ title: '列字段', help: '列字段', required: true }),
    dataIndex_or_field: 'dataIndex',
    key: 'dataIndex',
    placeholder: '',
    width: 160,
    col: 12,
    initialValue: '',
    list: [],
  },
  {
    form_type: 'Select',
    title_or_label: QuickTool.tooltip({ title: '编辑类型', help: '编辑类型', required: true }),
    dataIndex_or_field: 'form_type',
    key: 'form_type',
    placeholder: '',
    width: 160,
    col: 12,
    initialValue: '',
    list: [],
  },
  {
    form_type: 'Input',
    title_or_label: QuickTool.tooltip({ title: '宽度', help: '宽度', required: true }),
    dataIndex_or_field: 'width',
    key: 'width',
    placeholder: '',
    width: 160,
    col: 12,
    initialValue: '',
    list: [],
  },
  {
    form_type: 'Switch',
    title_or_label: QuickTool.tooltip({ title: '自动省略', help: '自动省略', required: true }),
    dataIndex_or_field: 'is_ellipsis',
    key: 'is_ellipsis',
    placeholder: '',
    width: 160,
    col: 12,
    initialValue: '',
    list: [],
  },
  {
    form_type: 'Switch',
    title_or_label: QuickTool.tooltip({ title: '可排序', help: '可排序', required: true }),
    dataIndex_or_field: 'is_sorter',
    key: 'is_sorter',
    placeholder: '',
    width: 160,
    col: 12,
    initialValue: '',
    list: [],
  },
  {
    form_type: 'Switch',
    title_or_label: QuickTool.tooltip({ title: '可超链接', help: '可超链接', required: true }),
    dataIndex_or_field: 'is_render',
    key: 'is_render',
    placeholder: '',
    width: 160,
    col: 12,
    initialValue: '',
    list: [],
  },
  {
    form_type: 'Switch',
    title_or_label: QuickTool.tooltip({
      title: '可tag显示',
      help: '可tag显示',
      required: true,
    }),
    dataIndex_or_field: 'is_tag',
    key: 'is_tag',
    placeholder: '',
    width: 160,
    col: 12,
    initialValue: '',
    list: [],
  },
  {
    form_type: 'Input',
    title_or_label: QuickTool.tooltip({ title: '排序', help: '排序', required: true }),
    dataIndex_or_field: 'sort',
    key: 'sort',
    placeholder: '',
    width: 160,
    col: 12,
    initialValue: '',
    list: [],
  },
  {
    form_type: 'Select',
    title_or_label: QuickTool.tooltip({ title: '列固定', help: '列固定', required: true }),
    dataIndex_or_field: 'fixed',
    key: 'fixed',
    placeholder: '',
    width: 160,
    col: 12,
    initialValue: '',
    list: [
      { value: '', name: '默认' },
      { value: 'left', name: 'left' },
      { value: 'right', name: 'right' },
    ],
  },
  {
    form_type: 'Input',
    title_or_label: QuickTool.tooltip({
      title: '分组列头文字',
      help: '分组列头文字',
      required: true,
    }),
    dataIndex_or_field: 'column_group',
    key: 'column_grounp',
    placeholder: '',
    width: 160,
    col: 12,
    initialValue: '',
    list: [],
  },
  {
    form_type: 'Select',
    title_or_label: QuickTool.tooltip({
      title: '单元格字体美化',
      help: '单元格字体美化',
      required: true,
    }),
    dataIndex_or_field: 'pretty_style',
    key: 'pretty_style',
    placeholder: '',
    width: 160,
    col: 12,
    initialValue: '',
    list: [
      { value: '', name: '默认' },
      { value: 'Tag', name: 'Tag' },
      { value: 'Badge', name: 'Badge' },
      { value: 'Progress', name: 'Progress' },
    ],
  },
];
const initialSearchList = [
  { ...fieldList[1], col: 6 },
  { ...fieldList[0], col: 6 },
  { form_type: '__operate', custom_sort: false },
  { ...fieldList[2], col: 6 },
  { ...fieldList[3], col: 6 },
];

const dataSource = [
  {
    sys_form_set_code: 'f97c6421decb',
    label: '内容发布',
    data_url: '/api/common/vw_baade_notice/page',
    placeholder: '请输入标签名称',
    size: 'middle',
    required: 1,
    tooltip: '发布内容的东西',
    rowKey: 'id',
    is_pagination: 0,
    is_add: 1,
    is_delete: 1,
    expanded_code: '',
    delete_url: '',
    editable: false,
    sort: 1,
  },
  {
    sys_form_set_code: 'f97c6421decb',
    label: '内容发布',
    data_url: '/api/common/vw_baade_notice/page',
    placeholder: '请输入标签名称',
    size: 'middle',
    required: 1,
    tooltip: '发布内容的东西',
    rowKey: 'id',
    is_pagination: 0,
    is_add: 1,
    is_delete: 1,
    expanded_code: '',
    delete_url: '',
    editable: false,
    sort: 2,
    field: 'content',
    form_type: 'Input',
  },
];

export {
  fieldList,
  initialSearchList,
  dataSource,
  apiPath,
  tableOperateExpandList,
  pagination,
  extraData,
  operationList,
  popupForm,
};
